#!/bin/bash
# Copyright (c) 2007-2011 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description:
# raptor script
# add mingw to the PATH if we are running Cygwin on Windows
#

if [ "$OSTYPE" == "cygwin" ]; then
	SBS_HOME=$(/bin/cygpath.exe -a -m "$0/../..")
else
	SBS_HOME=$(cd "${0%/*}/.." && echo $PWD)
fi

source $SBS_HOME/bin/sbs_env

export SBS_HOME

# call sbs.py with the arguments

RAPTOR_START="$SBS_HOME/bin/sbs.py"

if [ -e "$RAPTOR_START" ]; then
	# run the source version
	${__PYTHON__} "$RAPTOR_START" "$@"
elif [ -e "$RAPTOR_START"c ]; then
	# run the compiled version
	${__PYTHON__} "$RAPTOR_START"c "$@"
else
	echo "Cannot start SBSV2 - $RAPTOR_START not found." 1>&2
	echo "Check your SBS_HOME environment variable." 1>&2
fi
